import http from '@/utils/http'
 
export const reqOrderInfo = () => {
  return http.get("/order/trade")
}

export const reqOrderAddress = () => {
  return http.get('/userAddress/getOrderAddress')
}

/**
 * 
 * @param { Object } param {goodsId, blessing:祝福语}
 */
export const reqBuyNowGoods = ({goodsId, ...data}) => {
  return http.get(`/order/buy/${goodsId}`, data)
}

export const reqSumbmitOrder = (data) => {
  return http.post('/order/submitOrder', data)
}

/**
 * @description 获取微信支付预支付信息
 * @param {*} orderNo 订单ID
 */
export const reqPrePayInfo = (orderNo) => {
  return http.get(`/webChat/createJsapi/${orderNo}`)
}

export const reqPayStatus = (orderNo) => {
  return http.get(`/webChat/queryPayStatus/${orderNo}`)
}

export const reqOrderList = (page, limit) => {
  return http.get(`/order/order/${page}/${limit}`)
}